package com.wgchao.mdmp.common.aal;

import lombok.Data;

/**
 * @ClassName: GXYData
 * @author: wgchao
 * @createTime: 2019/11/4 3:56 PM
 * @Description: TODO
 */
@Data
public class GXYData implements ObjectData{
    private String gy;//高压 3
    private String dy;//低压 3
    private String xlv;//心率 3

    public static GXYData getInitializtion(String dataStr){
        GXYData gxy = new GXYData();
        int startLoc = 0;
        String childStr = null;
        gxy.gy = dataStr.substring(0, 3);
        startLoc += 3;
        childStr = dataStr.substring(startLoc);
        gxy.dy = childStr.substring(0,3);
        startLoc += 3;
        childStr = dataStr.substring(startLoc);
        gxy.xlv = childStr.substring(0,3);
        return gxy;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("血压计：{\n");
        sb.append("	高压:"+this.gy+"\n");
        sb.append("	低压:"+this.dy+"\n");
        sb.append("	心率:"+this.xlv+"\n");
        sb.append("}\n");
        return sb.toString();
    }

}